import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import i18n from "./lang/i18n";
import "./styles/index.scss";
import "./plugins";
import "./directive";
import "./mixin";
import "./util/error.log";
import storage from "@/util/storage";
// eslint-disable-next-line
Vue.prototype.$eventBus = new Vue({
  created() {
    if (storage.local.get("token")) {
      this.$store.dispatch("data/getDictAll");
      this.$store.dispatch("department/getSystemDepartmentListNoPage");
    }
  },
  router,
  store,
  i18n,
  render: (h) => h(App),
}).$mount("#app");
